use crate::src::src::compare_int::{int_compare, int_equal};
use crate::src::src::arraylist::{arraylist_insert, arraylist_sort, arraylist_new, arraylist_index_of, arraylist_free, arraylist_remove, arraylist_remove_range, arraylist_clear, arraylist_append, arraylist_prepend};
use crate::src::test::alloc_testing::{alloc_test_set_limit};
use crate::src::test::framework::{run_tests};
use crate::src::struct_and_type::{ArrayListCompareFunc, ArrayList, ArrayListValue, ArrayListEqualFunc, UnitTestFunction, _ArrayList};
use ::libc;
extern "C" {
    
    
    
    
    
    
    
    
    
    
    
    
    
    
}
#[no_mangle]
pub static mut variable1_test_arraylist: libc::c_int = 0;
#[no_mangle]
pub static mut variable2_test_arraylist: libc::c_int = 0;
#[no_mangle]
pub static mut variable3_test_arraylist: libc::c_int = 0;
#[no_mangle]
pub static mut variable4_test_arraylist: libc::c_int = 0;
#[no_mangle]
pub unsafe extern "C" fn generate_arraylist() -> *mut ArrayList {
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    let mut i: libc::c_int = 0;
    arraylist = arraylist_new(0 as libc::c_int as libc::c_uint);
    i = 0 as libc::c_int;
    while i < 4 as libc::c_int {
        arraylist_append(
            arraylist,
            &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue,
        );
        arraylist_append(
            arraylist,
            &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue,
        );
        arraylist_append(
            arraylist,
            &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue,
        );
        arraylist_append(
            arraylist,
            &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue,
        );
        i += 1;
        i;
    }
    return arraylist;
}
#[no_mangle]
pub unsafe extern "C" fn test_arraylist_new_free() {
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    arraylist = arraylist_new(0 as libc::c_int as libc::c_uint);
    assert!(!arraylist.is_null());
    arraylist_free(arraylist);
    arraylist = arraylist_new(10 as libc::c_int as libc::c_uint);
    assert!(!arraylist.is_null());
    arraylist_free(arraylist);
    arraylist_free(0 as *mut ArrayList);
    alloc_test_set_limit(0 as libc::c_int);
    arraylist = arraylist_new(0 as libc::c_int as libc::c_uint);
    assert!(arraylist.is_null());
    alloc_test_set_limit(1 as libc::c_int);
    arraylist = arraylist_new(100 as libc::c_int as libc::c_uint);
    assert!(arraylist.is_null());
}
#[no_mangle]
pub unsafe extern "C" fn test_arraylist_append() {
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    let mut i: libc::c_int = 0;
    arraylist = arraylist_new(0 as libc::c_int as libc::c_uint);
    assert!((*arraylist).length == 0 as libc::c_int as libc::c_uint);
    assert!(arraylist_append(arraylist, &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue)
        != 0 as libc::c_int);
    assert!((*arraylist).length == 1 as libc::c_int as libc::c_uint);
    assert!(arraylist_append(arraylist, &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue)
        != 0 as libc::c_int);
    assert!((*arraylist).length == 2 as libc::c_int as libc::c_uint);
    assert!(arraylist_append(arraylist, &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue)
        != 0 as libc::c_int);
    assert!((*arraylist).length == 3 as libc::c_int as libc::c_uint);
    assert!(arraylist_append(arraylist, &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue)
        != 0 as libc::c_int);
    assert!((*arraylist).length == 4 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(0 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(1 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(2 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(3 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    i = 0 as libc::c_int;
    while i < 10000 as libc::c_int {
        assert!(arraylist_append(arraylist, 0 as *mut libc::c_void) != 0 as libc::c_int);
        i += 1;
        i;
    }
    arraylist_free(arraylist);
    arraylist = arraylist_new(100 as libc::c_int as libc::c_uint);
    alloc_test_set_limit(0 as libc::c_int);
    i = 0 as libc::c_int;
    while i < 100 as libc::c_int {
        assert!(arraylist_append(arraylist, 0 as *mut libc::c_void) != 0 as libc::c_int);
        i += 1;
        i;
    }
    assert!((*arraylist).length == 100 as libc::c_int as libc::c_uint);
    assert!(arraylist_append(arraylist, 0 as *mut libc::c_void) == 0 as libc::c_int);
    assert!((*arraylist).length == 100 as libc::c_int as libc::c_uint);
    arraylist_free(arraylist);
}
#[no_mangle]
pub unsafe extern "C" fn test_arraylist_prepend() {
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    let mut i: libc::c_int = 0;
    arraylist = arraylist_new(0 as libc::c_int as libc::c_uint);
    assert!((*arraylist).length == 0 as libc::c_int as libc::c_uint);
    assert!(arraylist_prepend(arraylist, &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue)
        != 0 as libc::c_int);
    assert!((*arraylist).length == 1 as libc::c_int as libc::c_uint);
    assert!(arraylist_prepend(arraylist, &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue)
        != 0 as libc::c_int);
    assert!((*arraylist).length == 2 as libc::c_int as libc::c_uint);
    assert!(arraylist_prepend(arraylist, &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue)
        != 0 as libc::c_int);
    assert!((*arraylist).length == 3 as libc::c_int as libc::c_uint);
    assert!(arraylist_prepend(arraylist, &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue)
        != 0 as libc::c_int);
    assert!((*arraylist).length == 4 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(0 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(1 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(2 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(3 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    i = 0 as libc::c_int;
    while i < 10000 as libc::c_int {
        assert!(arraylist_prepend(arraylist, 0 as *mut libc::c_void) != 0 as libc::c_int);
        i += 1;
        i;
    }
    arraylist_free(arraylist);
    arraylist = arraylist_new(100 as libc::c_int as libc::c_uint);
    alloc_test_set_limit(0 as libc::c_int);
    i = 0 as libc::c_int;
    while i < 100 as libc::c_int {
        assert!(arraylist_prepend(arraylist, 0 as *mut libc::c_void) != 0 as libc::c_int);
        i += 1;
        i;
    }
    assert!((*arraylist).length == 100 as libc::c_int as libc::c_uint);
    assert!(arraylist_prepend(arraylist, 0 as *mut libc::c_void) == 0 as libc::c_int);
    assert!((*arraylist).length == 100 as libc::c_int as libc::c_uint);
    arraylist_free(arraylist);
}
#[no_mangle]
pub unsafe extern "C" fn test_arraylist_insert() {
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    let mut i: libc::c_int = 0;
    arraylist = generate_arraylist();
    assert!((*arraylist).length == 16 as libc::c_int as libc::c_uint);
    assert!(arraylist_insert(
        arraylist,
        17 as libc::c_int as libc::c_uint,
        &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue,
    ) == 0 as libc::c_int);
    assert!((*arraylist).length == 16 as libc::c_int as libc::c_uint);
    assert!((*arraylist).length == 16 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(4 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(5 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(6 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(arraylist_insert(
        arraylist,
        5 as libc::c_int as libc::c_uint,
        &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue,
    ) != 0 as libc::c_int);
    assert!((*arraylist).length == 17 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(4 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(5 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(6 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(7 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(0 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(1 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(2 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(arraylist_insert(
        arraylist,
        0 as libc::c_int as libc::c_uint,
        &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue,
    ) != 0 as libc::c_int);
    assert!((*arraylist).length == 18 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(0 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(1 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(2 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(3 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(15 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(16 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(17 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(arraylist_insert(
        arraylist,
        18 as libc::c_int as libc::c_uint,
        &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue,
    ) != 0 as libc::c_int);
    assert!((*arraylist).length == 19 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(15 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(16 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(17 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(18 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    i = 0 as libc::c_int;
    while i < 10000 as libc::c_int {
        arraylist_insert(
            arraylist,
            10 as libc::c_int as libc::c_uint,
            &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue,
        );
        i += 1;
        i;
    }
    arraylist_free(arraylist);
}
#[no_mangle]
pub unsafe extern "C" fn test_arraylist_remove_range() {
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    arraylist = generate_arraylist();
    assert!((*arraylist).length == 16 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(3 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(4 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(5 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(6 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    arraylist_remove_range(
        arraylist,
        4 as libc::c_int as libc::c_uint,
        3 as libc::c_int as libc::c_uint,
    );
    assert!((*arraylist).length == 13 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(3 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(4 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(5 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(6 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    arraylist_remove_range(
        arraylist,
        10 as libc::c_int as libc::c_uint,
        10 as libc::c_int as libc::c_uint,
    );
    arraylist_remove_range(
        arraylist,
        0 as libc::c_int as libc::c_uint,
        16 as libc::c_int as libc::c_uint,
    );
    assert!((*arraylist).length == 13 as libc::c_int as libc::c_uint);
    arraylist_free(arraylist);
}
#[no_mangle]
pub unsafe extern "C" fn test_arraylist_remove() {
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    arraylist = generate_arraylist();
    assert!((*arraylist).length == 16 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(3 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(4 as libc::c_int as isize)
        == &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(5 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(6 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    arraylist_remove(arraylist, 4 as libc::c_int as libc::c_uint);
    assert!((*arraylist).length == 15 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(3 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(4 as libc::c_int as isize)
        == &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(5 as libc::c_int as isize)
        == &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    assert!(*((*arraylist).data).offset(6 as libc::c_int as isize)
        == &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    arraylist_remove(arraylist, 15 as libc::c_int as libc::c_uint);
    assert!((*arraylist).length == 15 as libc::c_int as libc::c_uint);
    arraylist_free(arraylist);
}
#[no_mangle]
pub unsafe extern "C" fn test_arraylist_index_of() {
    let mut entries: [libc::c_int; 10] = [
        89 as libc::c_int,
        4 as libc::c_int,
        23 as libc::c_int,
        42 as libc::c_int,
        16 as libc::c_int,
        15 as libc::c_int,
        8 as libc::c_int,
        99 as libc::c_int,
        50 as libc::c_int,
        30 as libc::c_int,
    ];
    let mut num_entries: libc::c_int = 0;
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    let mut i: libc::c_int = 0;
    let mut index: libc::c_int = 0;
    let mut val: libc::c_int = 0;
    num_entries = (::core::mem::size_of::<[libc::c_int; 10]>() as libc::c_ulong)
        .wrapping_div(::core::mem::size_of::<libc::c_int>() as libc::c_ulong)
        as libc::c_int;
    arraylist = arraylist_new(0 as libc::c_int as libc::c_uint);
    i = 0 as libc::c_int;
    while i < num_entries {
        arraylist_append(
            arraylist,
            &mut *entries.as_mut_ptr().offset(i as isize) as *mut libc::c_int
                as ArrayListValue,
        );
        i += 1;
        i;
    }
    i = 0 as libc::c_int;
    while i < num_entries {
        val = entries[i as usize];
        index = arraylist_index_of(
            arraylist,
            Some(
                int_equal
                    as unsafe extern "C" fn(
                        *mut libc::c_void,
                        *mut libc::c_void,
                    ) -> libc::c_int,
            ),
            &mut val as *mut libc::c_int as ArrayListValue,
        );
        assert!(index == i);
        i += 1;
        i;
    }
    val = 0 as libc::c_int;
    assert!(arraylist_index_of(
        arraylist,
        Some(
            int_equal
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
        &mut val as *mut libc::c_int as ArrayListValue,
    ) < 0 as libc::c_int);
    val = 57 as libc::c_int;
    assert!(arraylist_index_of(
        arraylist,
        Some(
            int_equal
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
        &mut val as *mut libc::c_int as ArrayListValue,
    ) < 0 as libc::c_int);
    arraylist_free(arraylist);
}
#[no_mangle]
pub unsafe extern "C" fn test_arraylist_clear() {
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    arraylist = arraylist_new(0 as libc::c_int as libc::c_uint);
    arraylist_clear(arraylist);
    assert!((*arraylist).length == 0 as libc::c_int as libc::c_uint);
    arraylist_append(arraylist, &mut variable1_test_arraylist as *mut libc::c_int as ArrayListValue);
    arraylist_append(arraylist, &mut variable2_test_arraylist as *mut libc::c_int as ArrayListValue);
    arraylist_append(arraylist, &mut variable3_test_arraylist as *mut libc::c_int as ArrayListValue);
    arraylist_append(arraylist, &mut variable4_test_arraylist as *mut libc::c_int as ArrayListValue);
    arraylist_clear(arraylist);
    assert!((*arraylist).length == 0 as libc::c_int as libc::c_uint);
    arraylist_free(arraylist);
}
#[no_mangle]
pub unsafe extern "C" fn test_arraylist_sort() {
    let mut arraylist: *mut ArrayList = 0 as *mut ArrayList;
    let mut entries: [libc::c_int; 13] = [
        89 as libc::c_int,
        4 as libc::c_int,
        23 as libc::c_int,
        42 as libc::c_int,
        4 as libc::c_int,
        16 as libc::c_int,
        15 as libc::c_int,
        4 as libc::c_int,
        8 as libc::c_int,
        99 as libc::c_int,
        50 as libc::c_int,
        30 as libc::c_int,
        4 as libc::c_int,
    ];
    let mut sorted: [libc::c_int; 13] = [
        4 as libc::c_int,
        4 as libc::c_int,
        4 as libc::c_int,
        4 as libc::c_int,
        8 as libc::c_int,
        15 as libc::c_int,
        16 as libc::c_int,
        23 as libc::c_int,
        30 as libc::c_int,
        42 as libc::c_int,
        50 as libc::c_int,
        89 as libc::c_int,
        99 as libc::c_int,
    ];
    let mut num_entries: libc::c_uint = (::core::mem::size_of::<[libc::c_int; 13]>()
        as libc::c_ulong)
        .wrapping_div(::core::mem::size_of::<libc::c_int>() as libc::c_ulong)
        as libc::c_uint;
    let mut i: libc::c_uint = 0;
    arraylist = arraylist_new(10 as libc::c_int as libc::c_uint);
    i = 0 as libc::c_int as libc::c_uint;
    while i < num_entries {
        arraylist_prepend(
            arraylist,
            &mut *entries.as_mut_ptr().offset(i as isize) as *mut libc::c_int
                as ArrayListValue,
        );
        i = i.wrapping_add(1);
        i;
    }
    arraylist_sort(
        arraylist,
        Some(
            int_compare
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
    );
    assert!((*arraylist).length == num_entries);
    i = 0 as libc::c_int as libc::c_uint;
    while i < num_entries {
        let mut value: *mut libc::c_int = 0 as *mut libc::c_int;
        value = *((*arraylist).data).offset(i as isize) as *mut libc::c_int;
        assert!(*value == sorted[i as usize]);
        i = i.wrapping_add(1);
        i;
    }
    arraylist_free(arraylist);
    arraylist = arraylist_new(5 as libc::c_int as libc::c_uint);
    arraylist_sort(
        arraylist,
        Some(
            int_compare
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
    );
    assert!((*arraylist).length == 0 as libc::c_int as libc::c_uint);
    arraylist_free(arraylist);
    arraylist = arraylist_new(5 as libc::c_int as libc::c_uint);
    arraylist_prepend(
        arraylist,
        &mut *entries.as_mut_ptr().offset(0 as libc::c_int as isize) as *mut libc::c_int
            as ArrayListValue,
    );
    arraylist_sort(
        arraylist,
        Some(
            int_compare
                as unsafe extern "C" fn(
                    *mut libc::c_void,
                    *mut libc::c_void,
                ) -> libc::c_int,
        ),
    );
    assert!((*arraylist).length == 1 as libc::c_int as libc::c_uint);
    assert!(*((*arraylist).data).offset(0 as libc::c_int as isize)
        == &mut *entries.as_mut_ptr().offset(0 as libc::c_int as isize)
            as *mut libc::c_int as ArrayListValue);
    arraylist_free(arraylist);
}
static mut tests_test_arraylist: [UnitTestFunction; 10] = unsafe {
    [
        Some(test_arraylist_new_free as unsafe extern "C" fn() -> ()),
        Some(test_arraylist_append as unsafe extern "C" fn() -> ()),
        Some(test_arraylist_prepend as unsafe extern "C" fn() -> ()),
        Some(test_arraylist_insert as unsafe extern "C" fn() -> ()),
        Some(test_arraylist_remove as unsafe extern "C" fn() -> ()),
        Some(test_arraylist_remove_range as unsafe extern "C" fn() -> ()),
        Some(test_arraylist_index_of as unsafe extern "C" fn() -> ()),
        Some(test_arraylist_clear as unsafe extern "C" fn() -> ()),
        Some(test_arraylist_sort as unsafe extern "C" fn() -> ()),
        None,
    ]
};
unsafe fn main_0_test_arraylist(
    mut argc: libc::c_int,
    mut argv: *mut *mut libc::c_char,
) -> libc::c_int {
    run_tests(tests_test_arraylist.as_mut_ptr());
    return 0 as libc::c_int;
}
pub fn main_test_arraylist() {
    let mut args: Vec::<*mut libc::c_char> = Vec::new();
    for arg in ::std::env::args() {
        args.push(
            (::std::ffi::CString::new(arg))
                .expect("Failed to convert argument into CString.")
                .into_raw(),
        );
    }
    args.push(::core::ptr::null_mut());
    unsafe {
        ::std::process::exit(
            main_0_test_arraylist(
                (args.len() - 1) as libc::c_int,
                args.as_mut_ptr() as *mut *mut libc::c_char,
            ) as i32,
        )
    }
}
